package com.tommy.ddp.disposeHandler
{
	import com.tommy.ddp.GridDataManager;
	import com.tommy.ddp.box.DdpBox;
	import com.tommy.ddp.manager.DisposeBoxManager;

	/**
	 * 克隆出来的小炸弹，但只有在掉落全部结束以后才爆
	 * @author hongxuan
	 * 
	 */	
	public class BoomCloneDisposeHandler implements IDisposeHandler
	{
		public function BoomCloneDisposeHandler()
		{
		}
		
		public function dispose(box:DdpBox):Vector.<DdpBox>
		{
			box.dispose();
			GridDataManager.removeBox(box);
			
			var xS:int = box.column - 1;
			var xE:int = box.column + 1;
			
			var yS:int = box.row - 1;
			var yE:int = box.row + 1;
			
			var vect:Vector.<DdpBox> = new Vector.<DdpBox>();
			
			for(var i:int = xS;i<=xE;i++)
			{
				for(var j:int = yS;j<=yE;j++)
				{
					var b:DdpBox = GridDataManager.getBox(i,j);
					if(b && !b.isInDisposeList)
						//DisposeBoxManager.addDisposeBox(b);
						vect.push(b);
				}
			}
			
			return vect;
		}
	}
}